<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function fun(){
            alert("静态注册事件，所有代码")
        }

        window.onload = function (){
            alert("动态注册事件，所有代码")
        }
    </script>
</head>
<!--<body onload="fun();">-->
<body>
</body>
</html>